from selenium import webdriver

class person_:
    def __init__(self):
        self.wb = webdriver.Firefox()
        wb = self.wb
        wb.implicitly_wait(3)
        wb.get('http://localhost/smeoa/index.php/login')
        wb.find_element_by_id('emp_no').send_keys('admin')
        wb.find_element_by_id('password').send_keys('admin')
        wb.find_element_by_xpath('//input[@class="btn btn-sm btn-primary col-10"]').click()
        wb.find_element_by_xpath('/html/body/nav/div[2]/ul/a[9]').click()#进入人脉页面
        wb.find_element_by_xpath('/html/body/div[2]/div/div[1]/ul/li[1]/a').click()
        wb.find_element_by_xpath('//a[@href="/smeoa/index.php?m=profile&a=password"]').click()
        wb.find_element_by_id('password').send_keys('admin')
        wb.find_element_by_id('confirm_password').send_keys('admin')
        wb.find_element_by_xpath('/html/body/div[2]/div/div[2]/div[2]/div/div/div[2]/div/div/a').click()

        try:
            a = wb.find_element_by_id('gritter-notice-wrapper').text
            print(a)
        except:
            print('没发现')



if __name__ == '__main__':
    person_()